package com.pattern.strategy;


/**
 * 策略模式
 */
public class StrategySign {

    private People people;

    public StrategySign(People people){
        this.people = people;
    }

    public StrategySign(String name){
        if(name.equals("Xiaoming")){
            this.people = new Xiaoming();
        }else if(name.equals("Xiaohong")){
            this.people = new Xiaohong();
        }
    }

    public void run(){
        people.run();
    }

}
